﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Chromos.Actors;

namespace Chromos.ActionEngine
{
	public class WalkAction : VisualLoopingAction
	{
		FACING facing;
		public WalkAction(Actor actor, ContentManager content, Vector2 force, ForceType forceType, int animDelay, FACING facing)
			: base(actor, content, force, forceType, animDelay)
		{
			this.facing = facing;
		}

		public override void act()
		{
			base.act();
			if (forceType == ForceType.ForceContinuous && force.Y != 0 && currentImageIndex == 0)
				actor.velocity.Y += force.Y;
		}

		public override void start()
		{
			base.start();
			this.actor.setFacing(facing);
		}
	}
}
